<%--
  Created by IntelliJ IDEA.
  User: 谢兴鑫
  Date: 2022/5/10
  Time: 上午 11:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/layui/css/layui.css"/>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/layui/layui.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/jquery-3.5.1.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/ajaxForm.js"></script>
</head>

<script>


    layui.use(['table', 'util', 'jquery', 'layer', 'laypage'], function () {
        var table = layui.table, util = layui.util, $ = layui.jquery, layer = layui.layer, form = layui.form,
            laypage = layui.laypage;

        //上传员工流程图
        $('#add-emp').on("click", function () {
            layer.open({
                type: 2, //设置为iframe层
                fix: false, //不固定
                maxmin: true,//出现最大化最小化按钮
                offset: '5px',//垂直水平位置
                shade: 0.4, //遮罩层透明度
                area: ['480px', '500px'], //弹出层宽度高度
                title: "上传员工流程图", //弹出层标题
                content: '${pageContext.servletContext.contextPath}/holiday/goupload' //弹出层内网页
            });
        });
        //上传学生流程图
        $('#add-stu').on("click", function () {
            layer.open({
                type: 2, //设置为iframe层
                fix: false, //不固定
                maxmin: true,//出现最大化最小化按钮
                offset: '5px',//垂直水平位置
                shade: 0.4, //遮罩层透明度
                area: ['480px', '500px'], //弹出层宽度高度
                title: "上传学生流程图", //弹出层标题
                content: '${pageContext.servletContext.contextPath}/holidaystudent/stugoupload' //弹出层内网页
            });
        });

        //监听form表单提交  模糊查询  查看全部按钮
        form.on('submit(flush-btn)',function (d) {
            location.reload("tableData");//重新加载父页面表格
        });

    });
        //表格渲染
</script>

<body>
<br>
<a href="#">
    <button type="button" class="layui-btn layui-btn-sm" id="add-emp">
        <i class="layui-icon" style=" font-size: 15px; top: 200px ">&#xe681;上传员工请假流程</i>
    </button>
</a>
<a href="#">
    <button type="button" class="layui-btn layui-btn-sm" id="add-stu">
        <i class="layui-icon" style=" font-size: 15px; top: 200px ">&#xe681;上传学生请假流程</i>
    </button>
</a>

<a href="#" lay-filter="flush-btn"  lay-submit>
    <button class="layui-btn layui-btn-sm"><i class="layui-icon"
                                              style=" font-size: 15px; top: 200px ">&#xe669;刷新</i>
    </button>
</a>
<table class="layui-table">
    <thead>
    <tr>
        <th>流程版本</th>
        <th>流程名称</th>
        <th>流程KEY</th>
        <th>删除流程</th>
        <th>查看流程图</th>
        <th>下载流程图</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${quertList}" var="pd">
        <tr style="color: #ff5048">
            <td>${pd.id }</td>
            <td>${pd.name }</td>
            <td>${pd.key }</td>
            <td><a href="${pageContext.request.contextPath}/holiday/delprod?id=${pd.deploymentId}" onclick="return confirm('是否删除该流程？');">删除流程</a></td>
            <td><a href="${pageContext.request.contextPath}/holiday/viewImage?id=${pd.deploymentId}&imageName=${pd.diagramResourceName}">查看流程图</a></td>
            <td><a href="${pageContext.request.contextPath}/holiday/toExport?id=${pd.id}">下载流程图</a></td>
        </tr>
    </c:forEach>
    </tbody>
</table>
</body>
</html>
